package aconcagua.measure

import aconcagua.Aconcagua;

abstract class ArithmeticObject {

	// this is only for model initialization
	static { Aconcagua.initializeModel() };
	
	// accessing
	abstract amount();

	public denominator() {
		return unit().denominatorOf(amount());
	}

	public numerator() {
		return unit().numeratorOf(amount());
	}

	abstract unit();

	abstract unitNameOf(aUnit);

	// arithmetic operations
	abstract div(anArithmeticObject);

	abstract intdiv(anArithmeticObject);

	public minus(anArithmeticObject) {
		return this + anArithmeticObject.negate();
	}

	abstract mod(anArithmeticObject);

	abstract multiply(anArithmeticObject);

	abstract negate();

	abstract plus(anArithmeticObject);

	abstract round(aNumber);

	abstract trunc();

	// testing
	abstract boolean isNothing();
	
	public boolean isSomething() {
		return !this.isNothing();
	}
}
